package com.kylin.merchant.api.web.facade;

import com.kylin.merchant.api.dto.req.CreateMerchantReqDTO;
import com.kylin.merchant.api.dto.req.CreateShopReqDTO;
import com.kylin.merchant.api.dto.req.QueryMerchantReqDTO;
import com.kylin.merchant.api.dto.req.UpdateMerchantReqDTO;
import com.kylin.merchant.api.dto.resp.MerchantInfoRespDTO;
import com.kylin.merchant.api.dto.resp.ShopInfoRespDTO;
import com.kylin.shared.common.Pagination;
import com.kylin.shared.common.ResponseWrapper;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 商户管理接口
 * @author Wall.
 * @version v1.0.1
 * @date 2020年06月01日 10:50
 */
@RequestMapping(value = "/manage_v1/merchants", produces = MediaType.APPLICATION_JSON_VALUE)
public interface MerchantManageFacade {

    @GetMapping
    ResponseWrapper<Pagination<MerchantInfoRespDTO>> findMerchants(
            @Validated QueryMerchantReqDTO queryMerchantReqDTO
    );

    @PostMapping
    ResponseWrapper<Long> createMerchant(
            @Validated CreateMerchantReqDTO createMerchantReqDTO
    );


    @PutMapping
    ResponseWrapper<Long> updateMerchant(
            @Validated UpdateMerchantReqDTO updateMerchantReqDTO
    );


    @PostMapping("/{merchantId}/shop")
    ResponseWrapper<ShopInfoRespDTO> createShop(
            @PathVariable("merchantId")Long merchantId,
            @Validated CreateShopReqDTO createShopReqDTO
    );
}
